<div style="width: 90%; margin: 10px auto;">
<?php
/*for ($i=1; $i < 23; $i++)
{
	MessengerController::updateLastLogin($i);
}*/
$online = array();
$offline = array();
foreach ($data['messenger'] as $user)
{
	if($user['online'])
		$online[] = $user;
	else
		$offline[] = $user;
}

echo '<table>';
foreach ($online as $user)
{
	echo '<tr style="width: 100%;">';
	echo '<td style="width: 35%;"><img src="'.Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/avatar/'.$user['avatar'].'" style="width: 100%;padding: 1px;border: solid 1px #646464;"/></td>';
	echo '<td style="width: 60%;">'.$user['name'].'<br/></td>';
	//echo '<td>Id : '.$user['friend_id'].'</td>';
	echo '<td style="width:5%;"><img src="'.Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/iconUserOnline.png"/></td>';
	echo "</tr>";
}

foreach ($offline as $user)
{
	echo '<tr style="width: 100%;">';
	echo '<td style="width: 35%;"><img src="'.Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/avatar/'.$user['avatar'].'" style="width: 100%;padding: 1px;border: solid 1px #646464;"/></td>';
	echo '<td style="width: 60%;">'.$user['name'].'<br/></td>';
	//echo '<td>Id : '.$user['friend_id'].'</td>';
	echo '<td style="width:5%;"><img src="'.Yii::app()->request->baseUrl.'/themes/fly_high/assets/img/iconUserOffline.png"/></td>';
	echo "</tr>";
}
echo "</table>";
?>
</div>